package com.lvyq.javaprint.view.tray;

import com.lvyq.javaprint.view.toast.ToastView;
import javafx.animation.FadeTransition;
import javafx.application.Platform;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.util.Duration;

/**
 * @author lvyq 底部按钮设置
 * @version 1.0
 * Create by 2024-04-29 12:08
 */
public class BottomView {

    /**
     * @description 退出按钮
     * @author lvyq
     * @throws
     * @return Button
     * @time 2024-04-29 12:08
     */
    public static Button createExitBut(Stage trayStage) {
        Button button = new Button("退出");
        button.setStyle("-fx-graphic: 'img/exit.png';-fx-font-size: 15;-fx-text-fill: #808080;-fx-background-radius: 0");
        button.setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {
                if (mouseEvent.getButton()== MouseButton.PRIMARY){
                    //关闭托盘窗口
                    trayStage.close();
                    //退出程序
                    Platform.exit();
                    System.exit(0);
                }
            }
        });
        return button;
    }
    /**
     * @description 创建反馈
     * @author lvyq
     * @param[1] trayStage
     * @throws
     * @return Button
     * @time 2024-04-29 13:35
     */
    public static Button createFeedBackBut() {
        Button button = new Button("反馈");
        button.setStyle("-fx-graphic: 'img/feedback.png';-fx-font-size: 15;-fx-text-fill: #808080;-fx-background-radius: 0");
        button.setOnMouseClicked(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent mouseEvent) {

            }
        });
        return button;
    }
}
